﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_ServiceAccessPoint class represents the ability to use or invoke a service. Access points represent services that are available for use by other entities.
    /// </summary>
    public class CIM_ServiceAccessPoint : CIM_LogicalElement
    {

        private string _CreationClassName;
        private string _SystemCreationClassName;
        private string _SystemName;
        private Nullable<UInt32> _Type;

        /// <summary>
        /// Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified.
        /// </summary>
        public string CreationClassName { get { return _CreationClassName; } }

        /// <summary>
        /// Scoping system's creation class name.
        /// </summary>
        public string SystemCreationClassName { get { return _SystemCreationClassName; } }

        /// <summary>
        /// Scoping system's name.
        /// </summary>
        public string SystemName { get { return _SystemName; } }

        /// <summary>
        /// Type of SAP, such as attached or redirected.
        /// </summary>
        public Nullable<UInt32> Type { get { return _Type; } } //TODO enum

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_ServiceAccessPoint(ManagementBaseObject mbo)
            : base(mbo)
        {
            _CreationClassName = mbo.GetStringValue("CreationClassName");
            _SystemCreationClassName = mbo.GetStringValue("SystemCreationClassName");
            _SystemName = mbo.GetStringValue("SystemName");
            _Type = mbo.GetUIntValue("Type");
        }
    }
}
